package br.great.DAO;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* PhotoMap
* Copyright (c) 2007-2008 STEAMER - LIG, All rights reserved.
*/

/**
 * @author Developpement of PhotoMap
 */
public class DAO_CollectionHasContentAnnotation {
    int i;
    
    private static volatile DAO_CollectionHasContentAnnotation instaceDAO_CollectionHasContentAnnotation = new DAO_CollectionHasContentAnnotation();
    
    /** The private constructor of DAO_CollectionHasContentAnnotation for singleton
    */
    private DAO_CollectionHasContentAnnotation(){
    
    }
    
    /** The method for get the instance of the class DAO_CollectionHasContentAnnotation
    * @return DAO_CollectionHasContentAnnotation instaceDAO_CollectionHasContentAnnotation
    */
    public static DAO_CollectionHasContentAnnotation getInstance() {
        //if(instaceDAO_CollectionHasContentAnnotation==null)
           synchronized(DAO_CollectionHasContentAnnotation.class) {
             if (instaceDAO_CollectionHasContentAnnotation == null)
               instaceDAO_CollectionHasContentAnnotation = new DAO_CollectionHasContentAnnotation();
           }
        return instaceDAO_CollectionHasContentAnnotation;
    }
    
    public void insertCollectionHasContentAnnotation(int contentA, int idCollection){
        try {
            String insertCollectionHasContentAnnotation = "insert into Collection_Has_Content_Annotation values(" + contentA + "," + idCollection + ");";

            PgConnect conn = PgConnect.getInstance();
            conn.executeInsert(insertCollectionHasContentAnnotation);
            conn.Close();
        } catch (SQLException ex) {
            Logger.getLogger(DAO_CollectionHasContentAnnotation.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
//    public static void main(String[] args){
//        DAO_CollectionHasContentAnnotation dchca = DAO_CollectionHasContentAnnotation.getInstance();
//        dchca.insertCollectionHasContentAnnotation(1, 2);
//    }
}
